package com.selectable;

import javax.swing.*;
import java.awt.*;

public class Item extends JButton implements Selectable{
    private boolean select;
    public Item(String name){
        super(name);
    }
    @Override
    public void setSelect(boolean select) {
        this.select = select;
        selectWork(select);
    }

    @Override
    public boolean getSelect() {
        return false;
    }

    @Override
    public void setParentPanel(Component component) {

    }

    @Override
    public Component getParentPanel() {
        return null;
    }

    @Override
    public void selectWork(boolean select) {
        if(this.select){
            this.setBackground(Color.BLUE);
        }else{
            this.setBackground(Color.WHITE);
        }
    }
}
